<?php
$title = 'My Lamisa';
$this->headTitle ( $title );
?>

<div class="col-md-4">
	<div class="panel panel-default" style="width: 1070px; height: 575px; padding: 0;">
		<table height="auto" border="0" align="left"cellpadding="0" cellspacing="0">
			<tr>
				<div class="panel-heading">
					<h3 class="panel-title"><?php echo $this->translate('My Lamisa : Gestion des absences et des congés') ?></h3>
				</div>	
				<div class="panel panel-default" style="border: 1 none;width: 340px;float:left;margin-left: 10px;">

					<div class="panel-body" style="font-family: Times New Roman;">

							<h5 style="background-color: #008080;color:white;">
								<?php echo $this->translate('Demandes admnistratifs') ?>
							</h5>
							
							<?php 
							   	echo 'Completez le formulaire pour poser vôtre demande';
							   	echo'<br><br>';
							   	
								$form = $this->demandeform;
								$form->setAttribute ( 'action', $this->url ( 'demande', array (
										'action' => 'demande'
								) ) );
									
								$form->prepare ();
								echo $this->form ()->openTag ( $form );
								echo $this->formRow ( $form->get ( 'type_demande' ));
								echo $this->formRow ( $form->get ( 'demande' ));
							//	echo $this->formRow ( $form->get ( 'submit' ));
								
								?>
								<div class="control-group">
									<div class="controls">
										<button class="btn btn-primary">Envoyer</button>
										</div>
								</div>
								<?php
							 	echo $this->form ()->closeTag();

								if (isset($result)){
									?>
								<br>
								<div style ="color:red"> <?php echo $result ?> </div>
								<?php
								}
								
							?>
			
						<br>									
					</div>
				</div>
				  
					<div class="panel panel-default" style="border: 1 none;width: 690px; float:right;">

					<div class="panel-body" style="font-family: Times New Roman;">

							<h5  style="background-color: #008080;color:white;">
								<?php echo $this->translate('Suivi des demandes admnistratifs') ?>
							</h5>
							<div  id="suividemande"></div>
							
							<?php
									if(isset($reponsetraitement) && $reponsetraitement != null){
									 $i =1;
									 	// print_r($reponsetraitement);
									 echo '<b><div class="numero"> Numéro </div><div class="td">Type de demande </div><div class="reponset"> Réponse demande</div>	<div class="td">Date de traitement</div> </b><br>';
									echo '-----------------------------------------------------------------------------------------------------------------------------------';
										foreach ($reponsetraitement as $demande) {
										
								 		
										echo '<div class="numero">'.$i . ' </div>';
										switch ($demande->type_demande) {

											case 1:
												echo '<div class="td"> Absence </div> ';
												break;
											case 2:
												echo '<div class="td">Formation</div>';
												break;
											case 3:
												echo '<div class="td">Support</div>';
												break;
											case 4:
												echo '<div class="td">Matériel</div>';
												break;
											case 5:
												echo '<div class="td">Suggestions</div>';
												break;
											case 6:
												echo '<div class="td">Réclamation</div>';
												break;
											case 7:
												echo '<div class="td">Autres</div>';
												break;
											case null:
												echo '<div class="td"></div>';
												break;
										}
												
										$demande->type_demande ;

						 					if($demande->flag_traite ==1)
						 					{
						 						echo '<div class="reponset">';
						 						if($demande->code_reponse == -1 ){
						 							echo 'Votre demande est rejeté';
						 						}
						 						if($demande->code_reponse == 1 ){
						 							echo 'Votre demande est accepté';
						 						}
						 						if($demande->code_reponse == 0 ){
						 							echo 'Attente de justificatifs';
						 						}
						 						echo '</div>';
						 						echo '<div class="td">'.$demande->date_traitement . '</div>';
						 						
						 					}else {
						 							echo '<div class="reponset"> Votre demande est en attente de traitement </div>';
						 							echo '<div class="td">'.$demande->date_traitement . '</div>';
						 					}
						 					
						 						
								
										$i++;
										echo '-----------------------------------------------------------------------------------------------------------------------------------';
										echo '<br>';
										}										
									}
							 ?>
					
						<br>
						<br>									
					</div>
				</div>
			
			</tr>
		</table>
	</div>
</div>
